<template>
  <div>
    <div class="title">
      新鲜出炉
    </div>
    <div class="nr-title" v-for="(item) in list.zx" :key="item.title" @click="antclick(item)">{{item.title}}</div>
    <div class="title">
      最受欢迎
    </div>
    <div class="nr-title" v-for="(item,index) in list.zr" :key="String(index)" @click="antclick(item)">{{item.title}}</div>
    <div class="index-body-right-img" >
<!--      <img src="../../assets/images/ls/sjzx.png" style="width: 300px" alt="" />-->
      <img src="../../assets/images/ls/tjyd.png" style="width: 300px" alt="" @click="goList(113)"/>
    </div>
  </div>
</template>

<script>
import {readRight} from "@/utils/serve/classify";
export default {
  name: "ReadRight",
  props: {},
  data() {
    return {
      list:[]
    };
  },
  components: {
    // 第三方组件实例化
  },
  computed: {},
  methods: {
    // 方法
    antclick(e){
      console.log(e)
      this.$emit("antClick", {
        id:e.id
      });
    },
    goList(e){
      this.$router.push({
        name: 'ReadList',
        params: { id: e }
      });
    },
    readRight(){
      let _this = this;
      readRight(res=>{
        console.log(res)
        if(res.code==0){
          _this.list = res.data;
        }
      })
    }
  },
  mounted() {
    this.readRight()
  }
};
</script>

<style scoped lang="scss">
@import "./read";
</style>
